﻿#region namespace

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

#endregion

namespace Janus.Cores.Configuration
{
    public class ApplicationSection : ConfigurationElement
    {
        internal const string SECTION_NAME = "application";
        
        /// <summary>
        /// 默认数据库连接名称
        /// </summary>
        [ConfigurationProperty("currentCulture", IsRequired = false)]
        public string CurrentCulture
        {
            get
            {
                string val = this["currentCulture"] as string;
                if( string.IsNullOrEmpty(val) )
                    return System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
                return val;
            }
        }


        /// <summary>
        /// 慢查询
        /// </summary>
        [ConfigurationProperty("minDuration", IsRequired = false, DefaultValue = "10")]
        public int MinDuration
        {
            get
            {

                return (int)this["minDuration"];
            }
        }

        /// <summary>
        /// 安装模式
        /// </summary>
        [ConfigurationProperty("mode", IsRequired = false, DefaultValue = "VIP")]
        public string Mode
        {
            get
            {

                return (string)this["mode"];
            }
        }

        /// <summary>
        /// 是否允许病人多选
        /// </summary>
        [ConfigurationProperty("multiple", IsRequired = false)]
        public bool Multiple
        {
            get
            {
                return (bool)this["multiple"];
            }
        }

    }
}
